﻿@using Yyyg.WebUI.Models
@{
    ViewBag.Title = "PrizeAbout";
    Layout = "~/Views/Shared/_LayoutAbout.cshtml";
    int sum = Model.LastOrders.Sum(s => int.Parse(s.Createtime.ToString("HHmmss")));
    int sum2 = sum + Model.LottInfo.TicketNum;
    int yu = sum2 % Model.LottInfo.TotalNum;
}
@section head{
    @*<script src="~/Scripts/src/prizeAbout.js?version=2104211445"></script>*@
    <link href="~/Content/home-prizeabout.css" rel="stylesheet" />
}
@model PrizeAboutVM

<div class="content">
    <div class="tit">
        <h1>@Model.GoodInfo.Title</h1>
        <p>@Model.GoodInfo.Brin</p>
    </div>
    <div class="redblk">
        <span>期号 @Model.RushInfo.Per_num &nbsp;|&nbsp;幸运号码</span>
        <span>@Model.LottInfo.Lott_num</span>
    </div>
    <div class="userblk">
        <div>
            <img class="headimg" src="@Server.MapUserHead(Model.WinUser.Uid)" />
        </div>
        <div>
            <p>用户昵称:<a class="username" href="#">@Model.WinUser.Petname</a></p>
            <p>用 户ID:@Model.WinUser.Uid</p>
        </div>
        <div>
            <p>本期参与:<b style="color:red;">@(Model.LottInfo.Bycount)人次</b></p>
            <p>揭晓时间:@Model.LottInfo.Createtime.ToBeijingString()</p>
        </div>
    </div>
    <div class="calc">
        <div>
            <h4>如何计算?</h4>
            <div class="js">
                <span>@Model.LottInfo.Lott_num</span> =
                <span>10000001</span> +
                <span>@(yu)</span>
            </div>
            <div class="js-flg">
                <span>中奖号码</span><span>固定数值</span><span>变化数值</span>
            </div>
        </div>
        <div>
            <h4><span style="color:limegreen;font-weight:bold;">变化数值</span>是取下面公式的余数:</h4>
            <div class="bh">
                (<span>@sum</span> + <span>@Model.LottInfo.TicketNum</span>) ÷ <span>@Model.RushInfo.All_told</span>
            </div>
            <div class="bh-flg"><span>50个时间求和</span><span>“老时时彩”幸运号码</span><span>总需人次</span></div>
        </div>
    </div>
    <div class="myrobs">
        @if (Request.IsAuthenticated)
        {
            <div><a href="javascript:void(0);" onclick="Tools.showRobnums(@(Model.RushInfo.Id));">查看我的云购码</a></div>
        }
        else
        {
            <div><a href="/userLogin/login">请登陆</a> 查看你的云购号码</div>
        }
    </div>
    <div class="newpre">
        <p><b>[最新一期]</b> 火热进行中...</p>
        <div>
            <div class="layui-progress layui-progress-big" lay-showPercent="yes">
                <div class="layui-progress-bar  layui-bg-orange" lay-percent="@(Model.NewRush.NowPercentage())%"></div>
            </div>
            <span class="rem">剩余@(Model.NewRush.Rem)人次</span>
            <a style="color:white" href="/home/goodabout?rhid=@Model.NewRush.Id" class="layui-btn layui-btn-danger layui-btn-lg">立即前往</a>
        </div>
    </div>


</div>

@section tab1_title{计算结果}
@section tab1_content{
    <div class="tab1-content">
        <div class="m-detail-mainTab-calcRule">
            <h4>
                <span class="wrap">
                    <i class="iconfont icon-jilu"></i><span class="txt">幸运号码计算规则</span>
                </span>
            </h4>
            <div class="ruleWrap">
                <ol class="ruleList">
                    <li><span class="index">1</span>商品的最后一个号码分配完毕后，将公示截止该时间点本站全部商品的最后50个参与时间；</li>
                    <li><span class="index">2</span>将这50个时间的数值进行求和（得出数值A）（每个时间按时、分、秒的顺序组合，如20:15:25则为201525）；</li>
                    <li><span class="index">3</span>为保证公平公正公开，系统还会等待一小段时间，取最近下一期中国福利彩票“老时时彩”的揭晓结果（一个五位数值B）；</li>
                    <li><span class="index">4</span>（数值A+数值B）除以该商品总需人次得到的余数<i style="margin-top:-3px;" data-func="remainder" class="ico ico-questionMark"></i> + 原始数 10000001，得到最终幸运号码，拥有该幸运号码者，直接获得该商品。</li>
                    <li style="color:red">注：如遇福彩中心通讯故障，无法获取上述期数的中国福利彩票“老时时彩”揭晓结果，且24小时内该期“老时时彩”揭晓结果仍未公布，则默认“老时时彩”揭晓结果为00000。</li>
                </ol>
            </div>
        </div>
        <div class="tbx">
            <p class="tit">截止(@(Model.LottInfo.Createtime.ToBeijingString()))最后50条参与信息:</p>
            <table style="text-align:center" class="tabel-last50 layui-table layui-table-static" lay-size="sm">
                <thead>
                    <tr>
                        <th>编号</th>
                        <th>用户</th>
                        <th>购买日期</th>
                        <th>购买时间</th>
                        <th>计算值</th>
                        <th>商品名</th>
                        <th>参与人次</th>
                    </tr>
                </thead>
                <tbody>
                    @for (int i = 0; i < Model.LastOrders.Length; i++)
                    {
                        var or = Model.LastOrders[i];
                        <tr>
                            <td class="number">@(i+1)</td>
                            <td class="uinf">
                                <img src="@Server.MapUserHead(or.Uid)" style="width:20px;height:20px;" class="headimg" />
                                <a class="username" href="#">@or.Member.Petname</a>
                            </td>
                            <td class="bydate">@or.Createtime.ToLongDateString()</td>
                            <td class="bytime">@or.Createtime.ToLongTimeString()</td>
                            <td class="calctime iconfont">@or.Createtime.ToString("HHmmss")</td>
                            <td class="gd-tit"><a title="前往查看" href="/home/goodabout?rhid=@(or.Rushby_all.Id)">@or.Rushby_all.Goods.Title</a> </td>
                            <td>@or.Bycount</td>
                        </tr>
                    }
                    <tr class="total">
                        <td colspan="7">
                            <h4>50条计算结果</h4>
                            <div class="calcBox">
                                <div class="lef">
                                    <span>计算结果</span>
                                </div>
                                <div class="rig">
                                    <div class="dotbx">
                                        <span>1</span>
                                        <span>2</span>
                                        <span>3</span>
                                    </div>
                                    <div class="txtbx">
                                        <p>求和：<b>@(sum)</b>(上面50条云购记录时间取值相加之和) + <b>@Model.LottInfo.TicketNum</b>("老时时彩"开奖号码)</p>
                                        <p>取余：<b>@(sum2)</b>(50条时间记录之和+"老时时彩"开奖号码) % <b>@(Model.LottInfo.TotalNum)</b>(本商品总需参与人次) = <b>@(yu)</b> (余数)</p>
                                        <p>结果：<b>@(yu)</b>(余数) + <b>10000001</b>  = <b>@Model.LottInfo.Lott_num</b></p>
                                    </div>
                                </div>
                            </div>
                            <div class="resultBox">
                                <span>最终结果:  @Model.LottInfo.Lott_num</span>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
}

